home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 / Ham Radio 2000.iso / ham2000 / satellit / orbits / sgp4_pl2 / sgp_init.pas < prev    next >
Pascal/Delphi Source File  |  1992-10-06  |  3KB  |  116 lines

  1. Unit SGP_Init;
  2. {           Author:  Dr TS Kelso }
  3. { Original Version:  1992 Sep 01 }
  4. { Current Revision:  1992 Sep 13 }
  5. {          Version:  1.10 }
  6. {        Copyright:  1992, All Rights Reserved }
  7. {$N+}
  8.  
  9. INTERFACE
  10.  
  11. const
  12.   max_sats = 250;
  13.  
  14. type
  15.   line_data = string[69];
  16.   two_line  = array [1..2] of line_data;
  17.  
  18. var
  19.   visible              : boolean;
  20.   epoch                : double;
  21.   catnr,elset          : string;
  22.   obs_name             : string[25];
  23.   selected             : array [1..max_sats] of boolean;
  24.   sat_name             : array [1..max_sats] of string[22];
  25.   sat_data             : array [1..max_sats] of two_line;
  26.   data_drive,data_dir,
  27.   work_drive,work_dir  : string;
  28.  
  29. Procedure Program_Initialize(program_name : string);
  30. Procedure Program_End;
  31.  
  32. IMPLEMENTATION
  33.   Uses CRT,Support;
  34.  
  35. Procedure Program_Initialize(program_name : string);
  36.   var
  37.     space,lines : byte;
  38.     line,fn     : string;
  39.     fi          : text;
  40.   begin
  41. { Input header file describing program, 22 lines by 79 columns maximum }
  42.   ClrScr;
  43.   fn := program_name + '.HDR';
  44.   if File_Exists(fn) then
  45.     begin
  46.     Assign(fi,fn);
  47.     Reset(fi);
  48.     lines := 0;
  49.     repeat
  50.       lines := lines + 1;
  51.       Readln(fi,line);
  52.       Writeln(line);
  53.     until EOF(fi) or (lines = 22);
  54.     Close(fi);
  55.     end; {if}
  56. { Input directory configuration file }
  57.   fn := program_name + '.CFG';
  58.   if File_Exists(fn) then
  59.     begin
  60.     Assign(fi,fn);
  61.     Reset(fi);
  62.     Readln(fi,data_drive);
  63.     if data_drive <> '' then
  64.       begin
  65.       data_drive[1] := UpCase(data_drive[1]);
  66.       if data_drive[1] in ['A'..'Z'] then
  67.         data_drive := data_drive[1] + ':'
  68.       else
  69.         data_drive := '';
  70.       end; {if}
  71.     Readln(fi,data_dir);
  72.     if data_dir <> '' then
  73.       begin
  74.       space := Pos(' ',data_dir);
  75.       if space > 0 then
  76.         data_dir := Copy(data_dir,1,space-1);
  77.       if data_dir[Length(data_dir)] <> '\' then
  78.         data_dir := data_dir + '\';
  79.       end; {if}
  80.     Readln(fi,work_drive);
  81.     if work_drive <> '' then
  82.       begin
  83.       work_drive[1] := UpCase(work_drive[1]);
  84.       if work_drive[1] in ['A'..'Z'] then
  85.         work_drive := work_drive[1] + ':'
  86.       else
  87.         work_drive := '';
  88.       end; {if}
  89.     Readln(fi,work_dir);
  90.     if work_dir <> '' then
  91.       begin
  92.       space := Pos(' ',work_dir);
  93.       if space > 0 then
  94.         work_dir := Copy(work_dir,1,space-1);
  95.       if work_dir[Length(work_dir)] <> '\' then
  96.         work_dir := work_dir + '\';
  97.       end; {if}
  98.     Close(fi);
  99.     end {if}
  100.   else
  101.     begin
  102.     data_drive := '';
  103.     data_dir   := '';
  104.     work_drive := '';
  105.     work_dir   := '';
  106.     end; {else}
  107.   end; {Procedure Initialize}
  108.  
  109. Procedure Program_End;
  110.   begin
  111.   GotoXY(1,24);
  112.   Cursor_On;
  113.   end; {Procedure Program_End}
  114.  
  115. end.
  116.